/*
 * Copyright (c) Huawei Device Co., Ltd. 2023. All rights reserved.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
#include "secure_element_agent.h"
#include "service_load_callback.h"

#include <gtest/gtest.h>
#include <memory>

#include "common_utils.h"
#include "se_common_exception.h"
#include "loghelper.h"

namespace OHOS {
namespace SE {
namespace TEST {
using namespace testing::ext;
using namespace OHOS::SE;
using namespace OHOS::SE::OMAPI;

class SecureElementAgentTest : public testing::Test {
public:
    static void SetUpTestCase() {};
    static void TearDownTestCase() {};
    void SetUp() {};
    void TearDown() {};
};

/**
 * @tc.name: Initialize_Test001
 * @tc.desc: Test Session Initialize.
 * @tc.type: FUNC
 */
HWTEST_F(SecureElementAgentTest, Initialize_Test001, TestSize.Level1)
{
    bool connected = true;
    std::shared_ptr<SecureElementAgent> agent = std::make_shared<SecureElementAgent>("SIM");
    agent->OnStateChange(connected);
    agent->Initialize();
    EXPECT_TRUE(agent != nullptr);
}

/**
 * @tc.name: Initialize_Test002
 * @tc.desc: Test Session Initialize.
 * @tc.type: FUNC
 */
HWTEST_F(SecureElementAgentTest, Initialize_Test002, TestSize.Level1)
{
    bool connected = false;
    std::shared_ptr<SecureElementAgent> agent = std::make_shared<SecureElementAgent>("SIM");
    agent->OnStateChange(connected);
    agent->Initialize();
    EXPECT_TRUE(agent != nullptr);
}

/**
 * @tc.name: OpenBasicChannel_Test001
 * @tc.desc: Test Session OpenBasicChannel.
 * @tc.type: FUNC
 */
HWTEST_F(SecureElementAgentTest, OpenBasicChannel_Test001, TestSize.Level1)
{
    bool connected = false;
    std::string response = "";
    std::shared_ptr<SecureElementAgent> agent = std::make_shared<SecureElementAgent>("SIM");
    try {
        agent->OnStateChange(connected);
        agent->OpenBasicChannel("", 0, response);
    } catch (const IllegalStateError &e) {
        ErrorLog("exception happens.");
    }
    EXPECT_TRUE(agent != nullptr);
}

/**
 * @tc.name: OpenBasicChannel_Test002
 * @tc.desc: Test Session OpenBasicChannel.
 * @tc.type: FUNC
 */
HWTEST_F(SecureElementAgentTest, OpenBasicChannel_Test002, TestSize.Level1)
{
    bool connected = true;
    std::string response = "";
    std::shared_ptr<SecureElementAgent> agent = std::make_shared<SecureElementAgent>("SIM");
    try {
        agent->OnStateChange(connected);
        agent->OpenBasicChannel("", 0, response);
    } catch (const IllegalArgumentError &e) {
        ErrorLog("exception happens.");
    }
    EXPECT_TRUE(agent != nullptr);
}

/**
 * @tc.name: OpenBasicChannel_Test003
 * @tc.desc: Test Session OpenBasicChannel.
 * @tc.type: FUNC
 */
HWTEST_F(SecureElementAgentTest, OpenBasicChannel_Test003, TestSize.Level1)
{
    bool connected = true;
    std::string response = "";
    std::shared_ptr<SecureElementAgent> agent = std::make_shared<SecureElementAgent>("SIM");
    try {
        agent->OnStateChange(connected);
        agent->OpenBasicChannel("test", 0, response);
    } catch (const IllegalArgumentError &e) {
        ErrorLog("exception happens.");
    }
    EXPECT_TRUE(agent != nullptr);
}

/**
 * @tc.name: OpenBasicChannel_Test004
 * @tc.desc: Test Session OpenBasicChannel.
 * @tc.type: FUNC
 */
HWTEST_F(SecureElementAgentTest, OpenBasicChannel_Test004, TestSize.Level1)
{
    bool connected = true;
    std::string response = "";
    std::shared_ptr<SecureElementAgent> agent = std::make_shared<SecureElementAgent>("SIM");
    try {
        agent->OnStateChange(connected);
        agent->OpenBasicChannel("111111111111111111111111111111111111111111111111111111111111111111", 0, response);
    } catch (const IllegalArgumentError &e) {
        ErrorLog("exception happens.");
    }
    EXPECT_TRUE(agent != nullptr);
}

/**
 * @tc.name: OpenBasicChannel_Test005
 * @tc.desc: Test Session OpenBasicChannel.
 * @tc.type: FUNC
 */
HWTEST_F(SecureElementAgentTest, OpenBasicChannel_Test005, TestSize.Level1)
{
    std::string response = "";
    std::shared_ptr<SecureElementAgent> agent = std::make_shared<SecureElementAgent>("SIM");
    agent->OnStateChange(false);
    agent->Initialize();
    try {
        agent->OnStateChange(true);
        agent->OpenBasicChannel("1111111111111111", 0, response);
    } catch (const IllegalArgumentError &e) {
        ErrorLog("exception happens.");
    }
    EXPECT_TRUE(agent != nullptr);
}

/**
 * @tc.name: OpenBasicChannelWithoutChannelAccess_Test001
 * @tc.desc: Test Session OpenBasicChannelWithoutChannelAccess.
 * @tc.type: FUNC
 */
HWTEST_F(SecureElementAgentTest, OpenBasicChannelWithoutChannelAccess_Test001, TestSize.Level1)
{
    std::string response = "";
    std::shared_ptr<SecureElementAgent> agent = std::make_shared<SecureElementAgent>("123");
    try {
        agent->OnStateChange(false);
        agent->OpenBasicChannelWithoutChannelAccess("1111111111111111", 0, response);
    } catch (const IllegalStateError &e) {
        ErrorLog("exception happens.");
    }
    EXPECT_TRUE(agent != nullptr);
}

/**
 * @tc.name: OpenBasicChannelWithoutChannelAccess_Test002
 * @tc.desc: Test Session OpenBasicChannelWithoutChannelAccess.
 * @tc.type: FUNC
 */
HWTEST_F(SecureElementAgentTest, OpenBasicChannelWithoutChannelAccess_Test002, TestSize.Level1)
{
    std::string response = "";
    std::shared_ptr<SecureElementAgent> agent = std::make_shared<SecureElementAgent>("123");
    try {
        agent->OnStateChange(true);
        agent->OpenBasicChannelWithoutChannelAccess("", 0, response);
    } catch (const IllegalArgumentError &e) {
        ErrorLog("exception happens.");
    }
    EXPECT_TRUE(agent != nullptr);
}

/**
 * @tc.name: OpenBasicChannelWithoutChannelAccess_Test003
 * @tc.desc: Test Session OpenBasicChannelWithoutChannelAccess.
 * @tc.type: FUNC
 */
HWTEST_F(SecureElementAgentTest, OpenBasicChannelWithoutChannelAccess_Test003, TestSize.Level1)
{
    std::string response = "";
    std::shared_ptr<SecureElementAgent> agent = std::make_shared<SecureElementAgent>("123");
    try {
        agent->OnStateChange(true);
        agent->OpenBasicChannelWithoutChannelAccess("test", 0, response);
    } catch (const IllegalArgumentError &e) {
        ErrorLog("exception happens.");
    }
    EXPECT_TRUE(agent != nullptr);
}

/**
 * @tc.name: OpenBasicChannelWithoutChannelAccess_Test004
 * @tc.desc: Test Session OpenBasicChannelWithoutChannelAccess.
 * @tc.type: FUNC
 */
HWTEST_F(SecureElementAgentTest, OpenBasicChannelWithoutChannelAccess_Test004, TestSize.Level1)
{
    std::string response = "";
    std::shared_ptr<SecureElementAgent> agent = std::make_shared<SecureElementAgent>("123");
    try {
        agent->OnStateChange(true);
        agent->OpenBasicChannelWithoutChannelAccess("1111111111111111111111111111111111111111111111", 0, response);
    } catch (const IllegalArgumentError &e) {
        ErrorLog("exception happens.");
    }
    EXPECT_TRUE(agent != nullptr);
}

/**
 * @tc.name: OpenLogicalChannel_Test001
 * @tc.desc: Test Session OpenLogicalChannel.
 * @tc.type: FUNC
 */
HWTEST_F(SecureElementAgentTest, OpenLogicalChannel_Test001, TestSize.Level1)
{
    std::string response = "";
    std::shared_ptr<SecureElementAgent> agent = std::make_shared<SecureElementAgent>("123");
    try {
        agent->OnStateChange(false);
        agent->OpenLogicalChannel("1111111111111111111111111111111111111111111111", 0, response);
    } catch (const IllegalStateError &e) {
        ErrorLog("exception happens.");
    }
    EXPECT_TRUE(agent != nullptr);
}

/**
 * @tc.name: OpenLogicalChannel_Test002
 * @tc.desc: Test Session OpenLogicalChannel.
 * @tc.type: FUNC
 */
HWTEST_F(SecureElementAgentTest, OpenLogicalChannel_Test002, TestSize.Level1)
{
    std::string response = "";
    std::shared_ptr<SecureElementAgent> agent = std::make_shared<SecureElementAgent>("123");
    try {
        agent->OnStateChange(true);
        agent->OpenLogicalChannel("", 0, response);
    } catch (const IllegalArgumentError &e) {
        ErrorLog("exception happens.");
    }
    EXPECT_TRUE(agent != nullptr);
}

/**
 * @tc.name: OpenLogicalChannel_Test002
 * @tc.desc: Test Session OpenLogicalChannel.
 * @tc.type: FUNC
 */
HWTEST_F(SecureElementAgentTest, OpenLogicalChannel_Test003, TestSize.Level1)
{
    std::string response = "";
    std::shared_ptr<SecureElementAgent> agent = std::make_shared<SecureElementAgent>("123");
    try {
        agent->OnStateChange(true);
        agent->OpenLogicalChannel("test", 0, response);
    } catch (const IllegalArgumentError &e) {
        ErrorLog("exception happens.");
    }
    EXPECT_TRUE(agent != nullptr);
}

/**
 * @tc.name: OpenLogicalChannel_Test002
 * @tc.desc: Test Session OpenLogicalChannel.
 * @tc.type: FUNC
 */
HWTEST_F(SecureElementAgentTest, OpenLogicalChannel_Test004, TestSize.Level1)
{
    std::string response = "";
    std::shared_ptr<SecureElementAgent> agent = std::make_shared<SecureElementAgent>("123");
    try {
        agent->OnStateChange(true);
        agent->OpenLogicalChannel("1111111111111111111111111111111111111111111111111111111111111111", 0, response);
    } catch (const IllegalArgumentError &e) {
        ErrorLog("exception happens.");
    }
    EXPECT_TRUE(agent != nullptr);
}

/**
 * @tc.name: OpenLogicalChannelWithoutChannelAccess_Test001
 * @tc.desc: Test Session OpenLogicalChannelWithoutChannelAccess.
 * @tc.type: FUNC
 */
HWTEST_F(SecureElementAgentTest, OpenLogicalChannelWithoutChannelAccess_Test001, TestSize.Level1)
{
    std::string response = "";
    std::shared_ptr<SecureElementAgent> agent = std::make_shared<SecureElementAgent>("123");
    try {
        agent->OnStateChange(false);
        agent->OpenLogicalChannelWithoutChannelAccess("", 0, response);
    } catch (const IllegalStateError &e) {
        ErrorLog("exception happens.");
    }
    EXPECT_TRUE(agent != nullptr);
}

/**
 * @tc.name: OpenLogicalChannelWithoutChannelAccess_Test002
 * @tc.desc: Test Session OpenLogicalChannelWithoutChannelAccess.
 * @tc.type: FUNC
 */
HWTEST_F(SecureElementAgentTest, OpenLogicalChannelWithoutChannelAccess_Test002, TestSize.Level1)
{
    std::string response = "";
    std::shared_ptr<SecureElementAgent> agent = std::make_shared<SecureElementAgent>("123");
    try {
        agent->OnStateChange(true);
        agent->OpenLogicalChannelWithoutChannelAccess("", 0, response);
    } catch (const IllegalArgumentError &e) {
        ErrorLog("exception happens.");
    }
    EXPECT_TRUE(agent != nullptr);
}

/**
 * @tc.name: OpenLogicalChannelWithoutChannelAccess_Test003
 * @tc.desc: Test Session OpenLogicalChannelWithoutChannelAccess.
 * @tc.type: FUNC
 */
HWTEST_F(SecureElementAgentTest, OpenLogicalChannelWithoutChannelAccess_Test003, TestSize.Level1)
{
    std::string response = "";
    std::shared_ptr<SecureElementAgent> agent = std::make_shared<SecureElementAgent>("123");
    try {
        agent->OnStateChange(true);
        agent->OpenLogicalChannelWithoutChannelAccess("test", 0, response);
    } catch (const IllegalArgumentError &e) {
        ErrorLog("exception happens.");
    }
    EXPECT_TRUE(agent != nullptr);
}

/**
 * @tc.name: OpenLogicalChannelWithoutChannelAccess_Test004
 * @tc.desc: Test Session OpenLogicalChannelWithoutChannelAccess.
 * @tc.type: FUNC
 */
HWTEST_F(SecureElementAgentTest, OpenLogicalChannelWithoutChannelAccess_Test004, TestSize.Level1)
{
    std::string response = "";
    std::shared_ptr<SecureElementAgent> agent = std::make_shared<SecureElementAgent>("123");
    try {
        agent->OnStateChange(true);
        agent->OpenLogicalChannelWithoutChannelAccess("111111111111111111111111111111111111111111111111111111111111111",
            0, response);
    } catch (const IllegalArgumentError &e) {
        ErrorLog("exception happens.");
    }
    EXPECT_TRUE(agent != nullptr);
}

/**
 * @tc.name: Transmit_Test001
 * @tc.desc: Test Session Transmit.
 * @tc.type: FUNC
 */
HWTEST_F(SecureElementAgentTest, Transmit_Test001, TestSize.Level1)
{
    std::string response = "";
    std::shared_ptr<SecureElementAgent> agent = std::make_shared<SecureElementAgent>("123");
    try {
        agent->OnStateChange(false);
        agent->Transmit("");
    } catch (const IllegalStateError &e) {
        ErrorLog("exception happens.");
    }
    EXPECT_TRUE(agent != nullptr);
}

/**
 * @tc.name: Transmit_Test002
 * @tc.desc: Test Session Transmit.
 * @tc.type: FUNC
 */
HWTEST_F(SecureElementAgentTest, Transmit_Test002, TestSize.Level1)
{
    std::string response = "";
    std::shared_ptr<SecureElementAgent> agent = std::make_shared<SecureElementAgent>("eSE");
    try {
        agent->OnStateChange(true);
        agent->Transmit("");
    } catch (const IllegalStateError &e) {
        ErrorLog("exception happens.");
    }
    EXPECT_TRUE(agent != nullptr);
}

/**
 * @tc.name: Transmit_Test003
 * @tc.desc: Test Session Transmit.
 * @tc.type: FUNC
 */
HWTEST_F(SecureElementAgentTest, Transmit_Test003, TestSize.Level1)
{
    std::shared_ptr<SecureElementAgent> agent = std::make_shared<SecureElementAgent>("eSE");
    agent->OnStateChange(false);
    agent->Initialize();
    agent->OnStateChange(true);
    agent->Transmit("");
    EXPECT_TRUE(agent != nullptr);
}

/**
 * @tc.name: Transmit_Test004
 * @tc.desc: Test Session Transmit.
 * @tc.type: FUNC
 */
HWTEST_F(SecureElementAgentTest, Transmit_Test004, TestSize.Level1)
{
    std::shared_ptr<SecureElementAgent> agent = std::make_shared<SecureElementAgent>("eSE");
    agent->OnStateChange(false);
    agent->Initialize();
    agent->OnStateChange(true);
    agent->Transmit("111111111111111111111111111111");
    EXPECT_TRUE(agent != nullptr);
}

/**
 * @tc.name: Transmit_Test005
 * @tc.desc: Test Session Transmit.
 * @tc.type: FUNC
 */
HWTEST_F(SecureElementAgentTest, Transmit_Test005, TestSize.Level1)
{
    std::string response = "";
    std::shared_ptr<SecureElementAgent> agent = std::make_shared<SecureElementAgent>("SIM");
    try {
        agent->OnStateChange(true);
        agent->Transmit("");
    } catch (const IllegalStateError &e) {
        ErrorLog("exception happens.");
    }
    EXPECT_TRUE(agent != nullptr);
}

/**
 * @tc.name: Transmit_Test006
 * @tc.desc: Test Session Transmit.
 * @tc.type: FUNC
 */
HWTEST_F(SecureElementAgentTest, Transmit_Test006, TestSize.Level1)
{
    std::shared_ptr<SecureElementAgent> agent = std::make_shared<SecureElementAgent>("SIM");
    agent->OnStateChange(false);
    agent->Initialize();
    agent->OnStateChange(true);
    agent->Transmit("");
    EXPECT_TRUE(agent != nullptr);
}

/**
 * @tc.name: Transmit_Test007
 * @tc.desc: Test Session Transmit.
 * @tc.type: FUNC
 */
HWTEST_F(SecureElementAgentTest, Transmit_Test007, TestSize.Level1)
{
    std::shared_ptr<SecureElementAgent> agent = std::make_shared<SecureElementAgent>("SIM");
    agent->OnStateChange(false);
    agent->Initialize();
    agent->OnStateChange(true);
    agent->Transmit("111111111111111111111111111111111111");
    EXPECT_TRUE(agent != nullptr);
}

/**
 * @tc.name: CloseChannel_Test001
 * @tc.desc: Test Session CloseChannel.
 * @tc.type: FUNC
 */
HWTEST_F(SecureElementAgentTest, CloseChannel_Test001, TestSize.Level1)
{
    std::shared_ptr<SecureElementAgent> agent = std::make_shared<SecureElementAgent>("SIM");
    agent->OnStateChange(false);
    agent->CloseChannel(0, false, "");
    EXPECT_TRUE(agent != nullptr);
}

/**
 * @tc.name: CloseChannel_Test002
 * @tc.desc: Test Session CloseChannel.
 * @tc.type: FUNC
 */
HWTEST_F(SecureElementAgentTest, CloseChannel_Test002, TestSize.Level1)
{
    std::shared_ptr<SecureElementAgent> agent = std::make_shared<SecureElementAgent>("SIM");
    agent->OnStateChange(true);
    agent->CloseChannel(1, true, "");
    EXPECT_TRUE(agent != nullptr);
}

/**
 * @tc.name: CloseChannel_Test003
 * @tc.desc: Test Session CloseChannel.
 * @tc.type: FUNC
 */
HWTEST_F(SecureElementAgentTest, CloseChannel_Test003, TestSize.Level1)
{
    std::shared_ptr<SecureElementAgent> agent = std::make_shared<SecureElementAgent>("SIM");
    agent->OnStateChange(true);
    agent->CloseChannel(1, false, "");
    EXPECT_TRUE(agent != nullptr);
}

/**
 * @tc.name: CloseChannel_Test004
 * @tc.desc: Test Session CloseChannel.
 * @tc.type: FUNC
 */
HWTEST_F(SecureElementAgentTest, CloseChannel_Test004, TestSize.Level1)
{
    std::shared_ptr<SecureElementAgent> agent = std::make_shared<SecureElementAgent>("SIM");
    agent->OnStateChange(true);
    agent->CloseChannel(0, true, "");
    EXPECT_TRUE(agent != nullptr);
}

/**
 * @tc.name: CloseChannel_Test005
 * @tc.desc: Test Session CloseChannel.
 * @tc.type: FUNC
 */
HWTEST_F(SecureElementAgentTest, CloseChannel_Test005, TestSize.Level1)
{
    std::shared_ptr<SecureElementAgent> agent = std::make_shared<SecureElementAgent>("SIM");
    agent->OnStateChange(true);
    agent->CloseChannel(0, false, "");
    EXPECT_TRUE(agent != nullptr);
}

/**
 * @tc.name: CloseChannel_Test006
 * @tc.desc: Test Session CloseChannel.
 * @tc.type: FUNC
 */
HWTEST_F(SecureElementAgentTest, CloseChannel_Test006, TestSize.Level1)
{
    std::shared_ptr<SecureElementAgent> agent = std::make_shared<SecureElementAgent>("SIM");
    agent->OnStateChange(true);
    agent->CloseChannel(0, true, "");
    EXPECT_TRUE(agent != nullptr);
}

/**
 * @tc.name: CloseChannel_Test007
 * @tc.desc: Test Session CloseChannel.
 * @tc.type: FUNC
 */
HWTEST_F(SecureElementAgentTest, CloseChannel_Test007, TestSize.Level1)
{
    std::shared_ptr<SecureElementAgent> agent = std::make_shared<SecureElementAgent>("eSE");
    try {
        agent->OnStateChange(true);
        agent->CloseChannel(0, true, "");
    } catch (const IllegalStateError &e) {
        ErrorLog("exception happens.");
    }
    EXPECT_TRUE(agent != nullptr);
}

/**
 * @tc.name: CloseChannel_Test008
 * @tc.desc: Test Session CloseChannel.
 * @tc.type: FUNC
 */
HWTEST_F(SecureElementAgentTest, CloseChannel_Test008, TestSize.Level1)
{
    std::string response = "";
    std::shared_ptr<SecureElementAgent> agent = std::make_shared<SecureElementAgent>("eSE");
    try {
        agent->OnStateChange(false);
        agent->Initialize();
        agent->OnStateChange(true);
        agent->OpenLogicalChannelWithoutChannelAccess("1111111111111111", 0, response);
        agent->CloseChannel(0, true, response);
    } catch (const IllegalStateError &e) {
        ErrorLog("exception happens.");
    } catch (const NoSuchElementError &e) {
        ErrorLog("exception happens.");
    } catch (const UnsupportedOperationError &e) {
        ErrorLog("exception happens.");
    }
    EXPECT_TRUE(agent != nullptr);
}

/**
 * @tc.name: CloseChannels_Test001
 * @tc.desc: Test Session CloseChannels.
 * @tc.type: FUNC
 */
HWTEST_F(SecureElementAgentTest, CloseChannels_Test001, TestSize.Level1)
{
    std::shared_ptr<SecureElementAgent> agent = std::make_shared<SecureElementAgent>("eSE");
    agent->CloseChannels("");
    EXPECT_TRUE(agent != nullptr);
}

/**
 * @tc.name: CloseChannels_Test002
 * @tc.desc: Test Session CloseChannels.
 * @tc.type: FUNC
 */
HWTEST_F(SecureElementAgentTest, CloseChannels_Test002, TestSize.Level1)
{
    std::string response = "";
    std::shared_ptr<SecureElementAgent> agent = std::make_shared<SecureElementAgent>("123");
    try {
        agent->OnStateChange(true);
        agent->OpenLogicalChannelWithoutChannelAccess("11111111111111111111111111111", 0, response);
    } catch (const IllegalArgumentError &e) {
        ErrorLog("exception happens.");
    }
    agent->CloseChannels("");
    EXPECT_TRUE(agent != nullptr);
}

/**
 * @tc.name: OnLoadSystemAbilitySuccess_Test001
 * @tc.desc: Test Session OnLoadSystemAbilitySuccess.
 * @tc.type: FUNC
 */
HWTEST_F(SecureElementAgentTest, OnLoadSystemAbilitySuccess_Test001, TestSize.Level1)
{
    std::weak_ptr<SEService> seService;
    std::shared_ptr<ServiceLoadCallback> callback = std::make_shared<ServiceLoadCallback>(seService);
    callback->OnLoadSystemAbilitySuccess(0, nullptr);
    EXPECT_TRUE(callback != nullptr);
}

/**
 * @tc.name: OnLoadSystemAbilitySuccess_Test002
 * @tc.desc: Test Session OnLoadSystemAbilitySuccess.
 * @tc.type: FUNC
 */
HWTEST_F(SecureElementAgentTest, OnLoadSystemAbilitySuccess_Test002, TestSize.Level1)
{
    std::shared_ptr<SEService> seService = std::make_shared<SEService>();
    std::shared_ptr<ServiceLoadCallback> callback = std::make_shared<ServiceLoadCallback>(seService);
    callback->OnLoadSystemAbilitySuccess(0, nullptr);
    EXPECT_TRUE(callback != nullptr);
}

/**
 * @tc.name: OnLoadSystemAbilitySuccess_Test003
 * @tc.desc: Test Session OnLoadSystemAbilitySuccess.
 * @tc.type: FUNC
 */
HWTEST_F(SecureElementAgentTest, OnLoadSystemAbilitySuccess_Test003, TestSize.Level1)
{
    std::shared_ptr<SEService> seService = std::make_shared<SEService>();
    std::shared_ptr<ServiceLoadCallback> callback = std::make_shared<ServiceLoadCallback>(seService);
    callback->OnLoadSystemAbilitySuccess(1141, nullptr);
    EXPECT_TRUE(callback != nullptr);
}

/**
 * @tc.name: OnLoadSystemAbilityFail_Test001
 * @tc.desc: Test Session OnLoadSystemAbilityFail.
 * @tc.type: FUNC
 */
HWTEST_F(SecureElementAgentTest, OnLoadSystemAbilityFail_Test001, TestSize.Level1)
{
    std::weak_ptr<SEService> seService;
    std::shared_ptr<ServiceLoadCallback> callback = std::make_shared<ServiceLoadCallback>(seService);
    callback->OnLoadSystemAbilityFail(1141);
    EXPECT_TRUE(callback != nullptr);
}

/**
 * @tc.name: OnLoadSystemAbilityFail_Test002
 * @tc.desc: Test Session OnLoadSystemAbilityFail.
 * @tc.type: FUNC
 */
HWTEST_F(SecureElementAgentTest, OnLoadSystemAbilityFail_Test002, TestSize.Level1)
{
    std::shared_ptr<SEService> seService = std::make_shared<SEService>();
    std::shared_ptr<ServiceLoadCallback> callback = std::make_shared<ServiceLoadCallback>(seService);
    callback->OnLoadSystemAbilityFail(1141);
    EXPECT_TRUE(callback != nullptr);
}
} // TEST
} // SE
} // OHOS